Skip to content

Conversation

@IeuanWalker
Copy link
Owner

No description provided.

Updated `CreateWindow` to use simplified object instantiation.
Replaced `DisplayAlert` with `DisplayAlertAsync` across files
to improve asynchronous handling. Refactored null checks in
`TapGestureRecognizer_OnTapped` using the null-conditional
operator. Simplified class and interface definitions by
removing redundant braces. Streamlined `MainApplication`
constructor and removed unused imports in `TestViewModel`.
These changes enhance readability, maintainability, and
modernize the codebase.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses compiler warnings and messages by modernizing the C# codebase with various syntax improvements and refactorings.

  • Converts empty class/interface bodies to use C# file-scoped type declarations with semicolon syntax
  • Updates method calls from DisplayAlert to DisplayAlertAsync across multiple page implementations
  • Simplifies code with null-conditional operators and primary constructors
  • Removes formatting inconsistencies and unused attributes

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Scr/Handler/StateButtonHandler.cs Converts empty class body to semicolon syntax
Scr/Handler/IStateButtonHandler.cs Converts empty interface body to semicolon syntax
Demo/ViewModels/TestViewModel.cs Removes unused import and attribute, fixes spacing, updates DisplayAlert call
Demo/Platforms/Android/MainApplication.cs Refactors to use primary constructor syntax
Demo/Platforms/Android/MainActivity.cs Converts empty class body to semicolon syntax
Demo/Pages/EventCommandPage.xaml.cs Updates DisplayAlert calls and simplifies null checks with null-conditional operators
Demo/Pages/ButtonNotInScrollViewPage.xaml.cs Updates DisplayAlert method calls to DisplayAlertAsync
Demo/Pages/AccessibilityTestPage.xaml.cs Updates DisplayAlert method calls to DisplayAlertAsync
Demo/App.xaml.cs Simplifies Window instantiation using target-typed new expression

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

async void StateButton_Clicked(object sender, EventArgs e)
{
await DisplayAlert("Clicked", string.Empty, "OK");
await DisplayAlertAsync("Clicked", string.Empty, "OK");
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method name DisplayAlertAsync does not exist in the standard .NET MAUI ContentPage API. The correct method name is DisplayAlert. This change will cause compilation errors unless a custom extension method exists.

Copilot uses AI. Check for mistakes.
@IeuanWalker IeuanWalker merged commit f5b5fad into master Nov 12, 2025
7 checks passed
@IeuanWalker IeuanWalker deleted the WarningsMessages branch November 12, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants